package com.ljfresh.customer.result;

import com.ljfresh.customer.data.LoginData;
import com.ljfresh.customer.exception.ErrorMap;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: Lucifer
 * @time: 2020/4/8-9:46
 */
@ApiModel("登录返回类")
@Data
@NoArgsConstructor
public class LoginResult extends Result {

    @ApiModelProperty("登录数据")
    private LoginData loginData;

    public LoginResult(Integer code){
        this.code = code;
        this.message = ErrorMap.map.get(code);
    }

    public LoginResult(LoginData loginData){
        this.code = 0;
        this.message="请求成功!";
        this.loginData = loginData;
    }
}
